<template>
  <q-page class="q-pa-md page-container">
    <div class="q-pb-md text-h5">
      库存盘点
    </div>
    <div class="button-group" v-if="!loadingState">
      <div class="button-container">
        <q-btn style="width: 200px;" color="primary" label="库存盘点（已放行）" @click="ExportInvCheckReport('已放行')" />
      </div>
      <div class="button-container">
        <q-btn style="width: 200px;" color="primary" label="库存盘点（全部）" @click="ExportInvCheckReport('全部')" />
      </div>
      <div class="button-container">
        <q-btn style="width: 200px;" color="primary" label="库存盘点（未放行）" @click="ExportInvCheckReport('未放行')" />
      </div>
    </div>
  </q-page>

</template>

<script lang="ts">
export default {
  name: 'WmInvCheckStd'
}
</script>
<script lang="ts" setup>
import {ref} from 'vue';
let loadingState = ref(false)

const ExportInvCheckReport = function (releaseState: string){
  loadingState.value = true
  let url = $f.misc.makeUrlWithQueryParam('/project/mhlbc/rpt/export-inv-check-report?releaseState=' + releaseState)
  $f.nw.downloadFileWithAuth(url, '', true)
  loadingState.value = false
}
</script>

<style scoped>
.page-container {
  position: relative;
}
.button-group {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.button-container {
  margin: 10px;
  text-align: center;
}
</style>
